package edu.ahut.corejava2;

public class TestStack {//FILO:First In Last Out
    public static void main(String[] args) {
        int[] data = new int[10];
        int top = -1;//初始化栈
        for (int i = 0; i < 10; i++) {
            data[++top] = i;//入栈
        }
        while (top != -1/*判断空栈*/) {
            System.out.print(data[top]);//输出栈顶元素
            top--;//出栈操作
        }
    }
}
